<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="icon" href="favicon.ico" type="image/x-icon"/>
        <title>微信消息列表-微信管理-{$site.BACK_NAME}</title>
        <include file="Public:jscss" />
    </head>
    <body>
        <div class="wrap">
            <include file="Public:head" />
            <div class="mainBody">
                <include file="Public:left" />
                <div id="Right">
                    <div class="Item hr">
                        <div class="current">微信消息列表</div>
                    </div>
					<form action="" method="post" id="quickForm">
                        <b>快速搜索：</b>&nbsp;
                        <input placeholder="请输入关键字" id="kwd" class="input" type="text" name="kwd" value="{$kwd}" /> &nbsp;
						<input type="submit" class="btn quickSubmit" value='搜索'/>
                    </form>
					<form id="tab_form">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
                        <thead>
                            <tr>
								<td width="90">ID</td>
                                <td>用户微信OPENID</td>
                                <td>消息类型</td>
                                <td>消息内容</td>
                                <td>相关信息</td>
								<td>对话时间</td>
								<td>当前标示</td>
                                <td width="150">操作</td>
                            </tr>
                        </thead>
                        <volist name="list" id="vo">
						<tr align="center" id="tr_{$vo.id}">
							<td>{$vo.id}</td>
							<td align="left">{$vo.from_user_name}</td>
							<td>
								<switch name="vo.msg_type">
								<case value="text">文本</case>
								<case value="image">图片</case>
								<case value="voice">语音</case>
								<case value="video">视频</case>
								<case value="location">定位</case>
								<case value="link">链接</case>
								<default/><span style="color:red">未知</span>
								</switch>
							</td>
							<td>{$vo.content}</td>
							<td>{$vo.other_info}</td>
							<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
							<td>{$vo.last_sign}</td>
							<td>[ <a href="{:U('Weixin/wechat',array('act'=>'dialog','openid'=>$vo['from_user_name']))}">对话 </a> ]</td>
						</tr>
                        </volist>
                    </table>
					</form>
						<div class="viciao">{$page}</div>
						<div class="commonBtnArea" >
                        <button class="btn submit">删除所选</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <include file="Public:foot" />
    </body>
<script type="text/javascript">
clickCheckbox();
$(function(){
	//单个删除
	$(".del").click(function(){
		if($(this).attr("disabledSubmit")){
			$.jBox.tip('已提交，系统在处理中...', 'info');
			return false;
		}
		var news_id = $(this).attr("link");
		$.jBox.confirm(
			'您真的打算删除【<b>'+$(this).attr("name")+'</b>】吗?',
			"温馨提示",
			function(v, h, f) {
				if(v == 'ok'){
					$(".del[link='"+news_id+"']").attr("disabledSubmit",true).html("删除中...");
					$(".btn").attr("disabledSubmit",true);
					$.getJSON("{:U('Faq/del')}", {id:news_id}, function(json){
						if(json.status==1){
							$("#tr_"+news_id).remove();
							$.jBox.tip(json.info, 'success');
						}else{
							$.jBox.tip(json.info, 'error');
						}
					});
					$.jBox.tip("系统处理中，请稍候....", 'loading');
					return true;
				}
			}
		);	
	});
	//多个删除
	$(".submit").click(function(){
		if($(this).attr("disabledSubmit")){
			$.jBox.tip('已提交，系统在处理中...', 'info');
			return false;
		}
		if($("tbody input[type='checkbox']:checked").size()==0){
			$.jBox.tip('请先选择要删除的项', 'info');
			return false;
		}
		$.jBox.confirm(
			'您确定要删除该选定项吗?',
			"温馨提示",
			function(v, h, f) {
				if(v == 'ok'){
					$(".btn").attr("disabledSubmit",true);
					$(this).html("提交处理中...");
					commonAjaxSubmit("{:U('Faq/del')}", "#tab_form");
				}
			}
		);
		return false;
	});
});
</script>
</html>